package com.prs.crm.action.oa;

import java.io.File;
import java.util.Collection;
import java.util.Date;
import java.util.Iterator;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.struts.BaseAction;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.context.AppContext;
import com.prs.crm.context.FileUtil;
import com.prs.crm.context.ToolKits;
import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.hr.Person;
import com.prs.crm.domain.oa.Comment;
import com.prs.crm.domain.oa.CommentChild;
import com.prs.crm.domain.oa.News;
import com.prs.crm.domain.oa.NewsCollect;
import com.prs.crm.domain.oa.NewsCollectType;
import com.prs.crm.domain.oa.NewsReceive;
import com.prs.crm.service.AttachmentService;
import com.prs.crm.service.hr.PersonService;
import com.prs.crm.service.oa.CommentChildService;
import com.prs.crm.service.oa.CommentService;
import com.prs.crm.service.oa.NewsCollectService;
import com.prs.crm.service.oa.NewsCollectTypeService;
import com.prs.crm.service.oa.NewsReceiveService;
import com.prs.crm.service.oa.NewsService;

public class NewsAction extends BaseAction {
	private static final long serialVersionUID = 1L;
	private PaginationSupport pagination;
	private News news;
	private NewsService newsService;
	private NewsReceive newsReceive;
	private NewsReceiveService newsReceiveService;
	private NewsCollect newsCollect;
	private NewsCollectService newsCollectService;
	private NewsCollectType newsCollectType;
	private PersonService personService;
	private String accepts;  //接收人id
	private File upload;
	private String uploadFileName;
	private Integer[] newsIds;
	private Integer[] receiveIds;
	private Integer[] collectIds;
	private Integer[] typeIds;
	private String type;
	private NewsCollectTypeService newsCollectTypeService;
	private AttachmentService attachmentService;
	private CommentService commentService;
	private CommentChildService commentChildService;
	private List<NewsCollectType> newsCollectTypes;
	public List<NewsCollectType> getNewsCollectTypes() {
		return newsCollectTypes;
	}
	public void setNewsCollectTypes(List<NewsCollectType> newsCollectTypes) {
		this.newsCollectTypes = newsCollectTypes;
	}
	public CommentService getCommentService() {
		return commentService;
	}
	public void setCommentService(CommentService commentService) {
		this.commentService = commentService;
	}
	public CommentChildService getCommentChildService() {
		return commentChildService;
	}
	public void setCommentChildService(CommentChildService commentChildService) {
		this.commentChildService = commentChildService;
	}
	public AttachmentService getAttachmentService() {
		return attachmentService;
	}
	public void setAttachmentService(AttachmentService attachmentService) {
		this.attachmentService = attachmentService;
	}
	@Action("listHaveNews")
	public String listHaveNews() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				News.class);
		criteria.add(Restrictions.eq("oabox", 1));//查看不是草稿的新闻
		criteria.add(Restrictions.eq("recorder.id", AppContext.getAccountContext().currentUser().getId()));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listDraftNews")
	public String listDraftNews() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				News.class);
		criteria.add(Restrictions.eq("oabox", 0));  //查看草稿的新闻
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listReceiveNews")
	public String listReceiveNews() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				NewsReceive.class);
//		Person p = AppContext.getAccountContext().currentUser();
		criteria.add(Restrictions.eq("oabox", 1));  //1表示已收新闻
		System.out.println(AppContext.getAccountContext().currentUser().getId());
		criteria.add(Restrictions.eq("receivePerson.id", AppContext.getAccountContext().currentUser().getId()));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsCollectService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listCollectNews")
	public String listCollectNews() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				NewsCollect.class);
		criteria.add(Restrictions.eq("recorder.id", AppContext.getAccountContext().currentUser().getId()));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsCollectService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("listCollectType")
	public String listCollectType() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				NewsCollectType.class);
		
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsCollectService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action("editNews")
	public String editNews() {
		if(newsIds!=null){
			this.news=this.getNewsService().get(newsIds[0]);
		}
		return SUCCESS;
	}
	@Action("editDraftNews")
	public String editDraftNews() {
		if(this.newsIds!=null){
			this.news=this.newsService.get(newsIds[0]);
		}
		return SUCCESS;
	}
	@Action("editCollectType")
	public String editCollectType() {
		if(this.typeIds!=null){
			this.newsCollectType=this.newsCollectTypeService.get(typeIds[0]);
		}
		return SUCCESS;
	}
	@Action("viewNews")
	public String viewNews() {
		if(newsIds!=null){
			news=newsService.get(newsIds[0]);
		}
		return SUCCESS;
	}
	@Action("viewNewsReceive")
	public String viewNewsReceive() {
		if(this.receiveIds!=null){
			this.newsReceive=this.newsReceiveService.get(receiveIds[0]);
		}
		if(newsReceive.getState().equals("未读")){
			this.newsReceive.setState("已读");
			this.newsReceiveService.submit(newsReceive);
		}
		return SUCCESS;
	}
	@Action("forWardNews")
	public String forWardNews() {
		if (news!=null) {
			news.setContent("<BR><BR>----- Original Message ----- <BR>" +
					"From: "+news.getRecorder().getResume().getName()+"<BR>" +
					"To："+news.getReceive()+"<BR>" +
					"Title："+news.getTitle()+"<BR>" +
					"Content: <BR>"+news.getContent());
			news.setReceive("");
			news.setTitle("Fw: "+news.getTitle());	
		}
		if (newsReceive!=null) {
//			News ns=this.getNewsService().getNewsId(newsReceive.getNewsId());
//			if(ns!=null){
				news =new News();
				news.setContent("<BR><BR>----- Original Message ----- <BR>" +
								"From: "+newsReceive.getRecorder().getResume().getName()+"<BR>" +
								"To："+newsReceive.getReceivePerson().getResume().getName()+"<BR>" +
								"Title："+newsReceive.getTitle()+"<BR>" +
								"Content: <BR>"+newsReceive.getContent());
				news.setReceive("");
				news.setTitle("Fw: "+newsReceive.getTitle());
//			}
		}
		if(newsIds!=null){
			news=newsService.get(newsIds[0]);
			news.setContent("<BR><BR>----- Original Message ----- <BR>" +
							"From: "+news.getRecorder().getResume().getName()+"<BR>" +
							"To："+news.getReceive()+"<BR>" +
							"Title："+news.getTitle()+"<BR>" +
							"Content: <BR>"+news.getContent());
			news.setReceive("");
			news.setTitle("Fw: "+news.getTitle());
		}
		if(this.receiveIds!=null){
			this.newsReceive=this.newsReceiveService.get(receiveIds[0]);
//			this.news=this.newsReceive.getNews();
//			News ns=this.getNewsService().getNewsId(newsReceive.getNewsId());
//			if(ns!=null){
				news =new News();
				news.setContent("<BR><BR>----- Original Message ----- <BR>" +
						"From: "+newsReceive.getRecorder().getResume().getName()+"<BR>" +
						"To："+newsReceive.getReceivePerson().getResume().getName()+"<BR>" +
						"Title："+newsReceive.getTitle()+"<BR>" +
						"Content: <BR>"+newsReceive.getContent());
				news.setReceive("");
				news.setTitle("Fw: "+newsReceive.getTitle());
//			}
		}

		return SUCCESS;
	}
	@Action("ReplyNews")
	public String ReplyNews() {
		if(receiveIds!=null){
			this.newsReceive=this.newsReceiveService.get(receiveIds[0]);
//			this.news=newsReceive.getNews();
		}
		News ns=this.getNewsService().getNewsId(newsReceive.getNewsId());
		if (ns!=null) {
			if(type.equals("1")){  //回复全部
				news=new News();
				news.setReceive(ns.getReceive());
				news.setContent("<BR><BR>----- Original Message ----- <BR>" +
								"From: "+ns.getRecorder().getResume().getName()+"<BR>" +
								"To："+ns.getReceive()+"<BR>" +
								"Title："+ns.getTitle()+"<BR>" +
								"Content: <BR>"+ns.getContent());
				this.accepts=ns.getAccepts();
				news.setTitle("Re: "+ns.getTitle());
			}else{
				news=new News();
				news.setReceive(ns.getReceive());
				String[] receive=ns.getReceive().split(",");
				String[] acc=ns.getAccepts().split(",");
				news.setContent("<BR><BR>----- Original Message ----- <BR>" +
						"From: "+ns.getRecorder().getResume().getName()+"<BR>" +
						"To："+receive[0]+"<BR>" +
						"Title："+ns.getTitle()+"<BR>" +
						"Content: <BR>"+ns.getContent());
				this.accepts=acc[0];
				news.setTitle("Re: "+ns.getTitle());
			}
		}
		return SUCCESS;
	}
	@Action(value = "sendNews", results = {
			@Result(name = "success", type = "redirect", location = "editNews"),
			@Result(name = "error", type = "chain", location = "editNews") })
	public String sendNews() {
		//已发新闻设置
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			news.setAttach(attach);
		}	
		news.setOabox(1);//0表示草稿
		news.setTop(0);
		news.setCreatTime(new Date());
//		if (news.getId()==null) {
			news.setAccepts(accepts);
//		}
		
		this.newsService.save(news);
		//已收新闻设置
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(news.getAccepts().split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			NewsReceive re=new NewsReceive();
			re.setNewsId(news.getId());
			re.setTitle(news.getTitle());
			re.setContent(news.getContent());
			re.setDegree(news.getDegree());
			re.setDegree(news.getDegree());
			if (news.getAttach()!=null) {
				re.setAttach(news.getAttach());
			}
			re.setIsComment(news.getIsComment());
			re.setOabox(1);
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setState("未读");
			this.newsReceiveService.save(re);
		}
		this.setPrompt("新闻发送成功");
		return SUCCESS;
	}
	@Action(value = "sendNewsDraft", results = {
			@Result(name = "success", type = "redirect", location = "listDraftNews"),
			@Result(name = "error", type = "chain", location = "listDraftNews") })
	public String sendNewsDraft() {
		if (newsIds!=null) {
			news=this.getNewsService().get(newsIds[0]);
		}
		//已发新闻设置
		if(news.getReceive().equals("")){
			this.addActionError("请选择接收人");
			return ERROR;
		}
		news.setOabox(1);
		this.getNewsService().submit(news);
		//已收新闻设置
//		System.out.println(news.getAccepts());
		Collection<Person> acceptPersons = this.getPersonService().findPersons(ToolKits.convertStringAryToIntAry(news.getAccepts().split(",")));
		Iterator<Person> iter = acceptPersons.iterator();
		while(iter.hasNext()) {
			Person person = iter.next();
			NewsReceive re=new NewsReceive();
			re.setNewsId(news.getId());
			re.setTitle(news.getTitle());
			re.setContent(news.getContent());
			re.setDegree(news.getDegree());
			if (news.getAttach()!=null) {
				re.setAttach(news.getAttach());
			}
			re.setIsComment(news.getIsComment());
			re.setOabox(1);
			re.setSendPerson(AppContext.getAccountContext().currentUser()); //发送人
			re.setReceivePerson(person);  //接收人
			re.setState("未读");
			this.newsReceiveService.save(re);
		}
		this.setPrompt("新闻发送成功");
		return SUCCESS;
	}
	@Action(value = "saveNewsDraft", results = {
			@Result(name = "success", type = "redirect", location = "editNews"),
			@Result(name = "error", type = "chain", location = "editNews") })
	public String saveNewsDraft() {
		if(upload!=null){
			Attachment attach=FileUtil.getInstance().createAttach(upload, uploadFileName);
			this.getAttachmentService().save(attach);
			news.setAttach(attach);
		}
		news.setCreatTime(new Date());
		if (news.getId()!=null) {
			this.getNewsService().submit(news);
		}else{
			news.setOabox(0);
			news.setAccepts(accepts);
			this.getNewsService().save(news);
		}
		this.setPrompt("保存新闻到草稿箱成功");
		return SUCCESS;
	}
	@Action(value = "saveNewsCollectType", results = {
			@Result(name = "success", type = "redirect", location = "listCollectType"),
			@Result(name = "error", type = "chain", location = "editCollectType") })
	public String saveNewsCollectType() {
		if(newsCollectType.getId()==null){
		this.newsCollectTypeService.save(newsCollectType);
		}else{
			this.newsCollectTypeService.submit(newsCollectType);
		}
		return SUCCESS;
	}
	@Action(value = "saveNewsCollect", results = {
			@Result(name = "success", type = "redirect", location = "listHaveNews"),
			@Result(name = "error", type = "chain", location = "viewNews?news=${news.getId()}") })
	public String saveNewsCollect() {
		if(news!=null){
			NewsCollect collect=new NewsCollect();
			collect.setNews(news);
			NewsCollectType t=this.newsCollectTypeService.getTypeByName("已发新闻");
			if(t==null){
				t=new NewsCollectType();
				t.setName("已发新闻");
				this.newsCollectTypeService.save(t);
			}
			collect.setType(t);
			this.newsCollectService.save(collect);
			news.setOabox(3);  //3表示已收藏
			this.newsService.submit(news);
		}
		return SUCCESS;
	}
	@Action(value = "saveNewsCollect2", results = {
			@Result(name = "success", type = "redirect", location = "listReceiveNews"),
			@Result(name = "error", type = "chain", location = "viewNewsReceive?newsReceive=${newsReceive.getId()}") })
	public String saveNewsCollect2() {
			NewsCollect collect=new NewsCollect();
			collect.setNewsReceive(newsReceive);
			NewsCollectType t=this.newsCollectTypeService.getTypeByName("已收新闻");
			if(t==null){
				t=new NewsCollectType();
				t.setName("已收新闻");
				this.newsCollectTypeService.save(t);
			}
			collect.setType(t);
			this.newsCollectService.save(collect);
			newsReceive.setOabox(0);  //0表示已收藏
			this.newsReceiveService.submit(newsReceive);
		return SUCCESS;
	}
	@Action(value = "removeNews", results = {
			@Result(name = "success", type = "redirect", location = "listHaveNews"),
			@Result(name = "error", type = "chain", location = "listHaveNews") })
	public String removeNews() {
		for(Integer id:newsIds){
			News n=this.newsService.get(id);
			if(n.getCollects().size()!=0){
				this.addActionError("新闻已收藏,不能删除!");
				return ERROR;
			}
			for (int i = 0; i < n.getComment().size(); i++) {
				Comment c=n.getComment().get(i);
					for (int j = 0; j < c.getChilds().size(); j++) {
					CommentChild cc=c.getChilds().get(j);
					this.getCommentChildService().remove(cc);
				}
					this.getCommentService().remove(c);
			}
		}
		this.newsService.batchRemove(newsIds);
		return SUCCESS;
	}
	@Action(value = "removeDraftNews", results = {
			@Result(name = "success", type = "redirect", location = "listDraftNews"),
			@Result(name = "error", type = "chain", location = "listDraftNews") })
	public String removeDraftNews() {
		this.newsService.batchRemove(newsIds);
		return SUCCESS;
	}
	@Action(value = "deleteNews", results = {
			@Result(name = "success", type = "redirect", location = "listHaveNews"),
			@Result(name = "error", type = "chain", location = "viewNews?news=${news.getId()}") })
	public String deleteNews() {
//		if(news.getRecevies().size()!=0){
//			this.addActionError("新闻已发送,不能删除!");
//			return ERROR;
//		}else 
		for (int i = 0; i < news.getComment().size(); i++) {
			Comment c=news.getComment().get(i);
			for (int j = 0; j < c.getChilds().size(); j++) {
				CommentChild cc=c.getChilds().get(j);
				this.getCommentChildService().remove(cc);
			}
				this.getCommentService().remove(c);
		}
		this.newsService.remove(news);
		return SUCCESS;
	}
	@Action(value = "removeNewsReceive", results = {
			@Result(name = "success", type = "redirect", location = "listReceiveNews"),
			@Result(name = "error", type = "chain", location = "listReceiveNews") })
	public String removeNewsReceive() {
		for (Integer id : receiveIds) {
			newsReceive=this.getNewsReceiveService().get(id);
			for (int i = 0; i < newsReceive.getComment().size(); i++) {
			Comment c=newsReceive.getComment().get(i);
				for (int j = 0; j < c.getChilds().size(); j++) {
				CommentChild cc=c.getChilds().get(j);
				this.getCommentChildService().remove(cc);
			    }
				this.getCommentService().remove(c);
			}
		}
		this.newsReceiveService.batchRemove(receiveIds);
		return SUCCESS;
	}
	@Action(value = "removeNewsCollect", results = {
			@Result(name = "success", type = "redirect", location = "listCollectNews"),
			@Result(name = "error", type = "chain", location = "listCollectNews") })
	public String removeNewsCollect() {	
		this.newsCollectService.batchRemove(collectIds);
		return SUCCESS;
	}
	@Action(value = "removeCollectType", results = {
			@Result(name = "success", type = "redirect", location = "listCollectType"),
			@Result(name = "error", type = "chain", location = "listCollectType") })
	public String removeCollectType() {
		for(int i=0;i<typeIds.length;i++){
			this.newsCollectType=this.newsCollectTypeService.get(typeIds[i]);
			if(newsCollectType.getNewsCollects().size()!=0){
				this.addActionError("类别已关联收藏，不能删除");
				return ERROR;
			}
		}
		this.newsCollectTypeService.batchRemove(typeIds);
		return SUCCESS;
	}
	@Action(value = "deleteNewsReceive", results = {
			@Result(name = "success", type = "redirect", location = "listReceiveNews"),
			@Result(name = "error", type = "chain", location = "viewNewsReceive?newsReceive=${newsReceive.getId()}") })
	public String deleteNewsReceive() {
		for (int i = 0; i < newsReceive.getComment().size(); i++) {
			Comment c=newsReceive.getComment().get(i);
				for (int j = 0; j < c.getChilds().size(); j++) {
				CommentChild cc=c.getChilds().get(j);
				this.getCommentChildService().remove(cc);
			    }
				this.getCommentService().remove(c);
			}
		this.newsReceiveService.remove(this.newsReceive);
		return SUCCESS;
	}
	
	@Action("listViewNews")
	public String listViewNews() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				News.class);
		criteria.add(Restrictions.eq("oabox", 1));  
		criteria.addOrder(Order.desc("top"));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.newsService.listByPage(criteria,
				pagination));
		return SUCCESS;
	}
	@Action(value = "saveNewsTop", results = {
			@Result(name = "success", type = "redirect", location = "listViewNews"),
			@Result(name = "error", type = "chain", location = "listViewNews") })
	public String saveNewsTop(){
		if(newsIds!=null){
			this.news=this.getNewsService().get(newsIds[0]);
		}
		news.setTop(1);
		this.getNewsService().save(news);
		return SUCCESS;
	}
	@Action(value = "saveNotTop", results = {
			@Result(name = "success", type = "redirect", location = "listViewNews"),
			@Result(name = "error", type = "chain", location = "listViewNews") })
	public String saveNotTop(){
		if(newsIds!=null){
			this.news=this.getNewsService().get(newsIds[0]);
		}
		news.setTop(0);
		this.getNewsService().save(news);
		return SUCCESS;
	}
	
	@Action(value = "removeNew", results = {
			@Result(name = "success", type = "redirect", location = "listViewNews"),
			@Result(name = "error", type = "chain", location = "listViewNews") })
	public String removeNew() {
		for(Integer id:newsIds){
			News n=this.newsService.get(id);
//			if(n.getRecevies().size()!=0){
//				this.addActionError("新闻已发送,不能删除!");
//				return ERROR;
//			}else 
			if(n.getCollects().size()!=0){
				this.addActionError("新闻已收藏,不能删除!");
				return ERROR;
			}
		}
		this.newsService.batchRemove(newsIds);
		return SUCCESS;
	}
	@Action("viewNew")
	public String viewNew() {
		if(newsIds!=null){
			news=newsService.get(newsIds[0]);
		}
		return SUCCESS;
	}
	@Action(value = "editNewsMove", results = {
		@Result(name = "error", type = "chain", location = "listCollectNews") })
	public String editNewsMove(){
		if (collectIds!=null) {
			this.newsCollect=this.getNewsCollectService().get(collectIds[0]);
		}else{
			this.addActionError("请选择一行进行操作！");
			return ERROR;
		}
		newsCollectTypes=this.getNewsCollectTypeService().getAll();
		return SUCCESS;
	}
	@Action(value = "saveNewsMove", results = {
			@Result(name = "success", type = "redirect", location = "listCollectNews"),
			@Result(name = "error", type = "chain", location = "editNewsMove") })
	public String saveNewsMove(){
		if (newsCollect==null) {
			this.addActionError("请选择一项进行移动！");
			return ERROR;
		}
		this.getNewsCollectService().submit(newsCollect);
		return SUCCESS;
	}
	public String editCommentChild(){
		return SUCCESS;
	}
	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	public NewsService getNewsService() {
		return newsService;
	}

	public void setNewsService(NewsService newsService) {
		this.newsService = newsService;
	}
	public NewsReceive getNewsReceive() {
		return newsReceive;
	}
	public void setNewsReceive(NewsReceive newsReceive) {
		this.newsReceive = newsReceive;
	}
	public NewsReceiveService getNewsReceiveService() {
		return newsReceiveService;
	}
	public void setNewsReceiveService(NewsReceiveService newsReceiveService) {
		this.newsReceiveService = newsReceiveService;
	}
	public String getAccepts() {
		return accepts;
	}
	public void setAccepts(String accepts) {
		this.accepts = accepts;
	}
	public File getUpload() {
		return upload;
	}
	public void setUpload(File upload) {
		this.upload = upload;
	}
	public String getUploadFileName() {
		return uploadFileName;
	}
	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}
	public PersonService getPersonService() {
		return personService;
	}
	public void setPersonService(PersonService personService) {
		this.personService = personService;
	}
	public Integer[] getNewsIds() {
		return newsIds;
	}
	public void setNewsIds(Integer[] newsIds) {
		this.newsIds = newsIds;
	}
	public NewsCollect getNewsCollect() {
		return newsCollect;
	}
	public void setNewsCollect(NewsCollect newsCollect) {
		this.newsCollect = newsCollect;
	}
	public NewsCollectService getNewsCollectService() {
		return newsCollectService;
	}
	public void setNewsCollectService(NewsCollectService newsCollectService) {
		this.newsCollectService = newsCollectService;
	}
	public Integer[] getReceiveIds() {
		return receiveIds;
	}
	public void setReceiveIds(Integer[] receiveIds) {
		this.receiveIds = receiveIds;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public NewsCollectTypeService getNewsCollectTypeService() {
		return newsCollectTypeService;
	}
	public void setNewsCollectTypeService(
			NewsCollectTypeService newsCollectTypeService) {
		this.newsCollectTypeService = newsCollectTypeService;
	}
	public Integer[] getCollectIds() {
		return collectIds;
	}
	public void setCollectIds(Integer[] collectIds) {
		this.collectIds = collectIds;
	}
	public NewsCollectType getNewsCollectType() {
		return newsCollectType;
	}
	public void setNewsCollectType(NewsCollectType newsCollectType) {
		this.newsCollectType = newsCollectType;
	}
	public Integer[] getTypeIds() {
		return typeIds;
	}
	public void setTypeIds(Integer[] typeIds) {
		this.typeIds = typeIds;
	}
	
}
